<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    a{
        text-decoration: none;
        color: black;
    }
</style>
<body>
    <ul>
        <li>第一</li>
        <li>第二</li>
        <li>第三</li>
        <li>我是垃圾</li>
    </ul>
    <!-- <a href="https://deepseek.com">跳转</a>
    <button>按钮</button> -->
    <script>
        const ul=document.querySelector('ul')
        ul.addEventListener('click',function(e){
            ul.style.color = 'red'
            // if(e.target.tagName==='LI'){
            //     this.style.color='pink'
            // }
        })




        // function(){}
        // const a=document.querySelector('a')
        // a.addEventListener('click',function(e){
        //     e.preventDefault
        // })
    </script>
</body>
</html>